package com.sali;

import com.sali.service.MyTestService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.io.support.SpringFactoriesLoader;

import java.util.List;

@SpringBootApplication
public class SpringSpiTest01Application {

    public static void main(String[] args) {
        SpringApplication.run(SpringSpiTest01Application.class, args);

        List<MyTestService> myTestServices = SpringFactoriesLoader.loadFactories(MyTestService.class, Thread.currentThread().getContextClassLoader());

        for (MyTestService testService : myTestServices) {
            testService.printMylife();
        }
    }

}
